package com.hut.oa.model.bean;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 公告通知与用户关系表
 * @author 熊涛
 *
 */
@Entity
@Table(name="announce_user")
public class AnnounceUser {
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="au_id")	
	private Long auId;//公告通知用户表id
	
	@JoinColumn(name="au_user_id")	
	@ManyToOne
	private User user;//接收用户id
	
	@JsonIgnore
	@JoinColumn(name="au_ann_id")
	@ManyToOne
	private Announce announce;//公告通知id
	
	@Column(name="au_is_read")	
	private Integer auIsRead=0;//是否已阅
	
	public AnnounceUser() {}
	
	public AnnounceUser(User user, Announce announce) {
		super();
		this.user = user;
		this.announce = announce;
	}

	public Long getAuId() {
		return auId;
	}

	public void setAuId(Long auId) {
		this.auId = auId;
	}

	public Integer getAuIsRead() {
		return auIsRead;
	}

	public void setAuIsRead(Integer auIsRead) {
		this.auIsRead = auIsRead;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Announce getAnnounce() {
		return announce;
	}

	public void setAnnounce(Announce announce) {
		this.announce = announce;
	}

	@Override
	public String toString() {
		return "AnnounceUser [auId=" + auId + ", auIsRead=" + auIsRead + "]";
	}

}
